# 以下的内容必须自己先进行推导
# 1.判断下列逻辑语句的True,False.
# 1）1 > 1 or 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6
#    3 < 4 or 4 > 5  or 7 < 6 一个true 到true
# 2）not 2 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6
#----->false
#
#
#
#
#
#
# 2.求出下列逻辑语句的值。
# 1),8 or 3 and 4 or 2 and 0 or 9 and 7=8
# 2) 0 or 2 and 3 and 4 or 6 and 0 or 3=4
#
#
#
# 3.下列结果是什么？
# 1)、6 or 2 > 1=6
# 2)、3 or 2 > 1=3
# 3)、0 or 5 < 4=false
# 4)、5 < 4 or 3= 3
# 5)、2 > 1 or 6= true
# 6)、3 and 2 > 1= 3
# 7)、0 and 3 > 1=true
# 8)、2 > 1 and 3=3
# 9)、3 > 1 and 0= 0
# 10)、3 > 1 and 2 or 2 < 3 and 3 and 4 or 3 > 2 = 2
#



# 4.while循环语句基本结构？

#while True,keep going.number count. break. continue
#




# 5.利用while语句写出猜大小的游戏：
# 设定一个理想数字比如：66，让用户输入数字，如果比66大，则显示猜测的结果大了；如果比66小，则显示猜测的结果小了;只有等于66，显示猜测结果正确，然后退出循环。
#
#

# while True:
#     num = int(input("give me a number"))
#     num1=27
#     if num==num1:
#         print( "correct")
#         break
#     elif num > num1:
#         print( "too big")
#     elif num < num1:
#         print( "too small")
#     else:
#         print(" enter a number")





# 6.在5题的基础上进行升级：
# 给用户三次猜测机会，如果三次之内猜测对了，则显示猜测正确，退出循环，如果三次之内没有猜测正确，则自动退出循环，并显示‘太笨了你....’。
# #
# c=0
# while c<3:
#     num = int(input("give me a number"))
#     num1 = 27
#     if num == num1:
#         print("correct")
#         break
#     elif num > num1:
#         print("too big")
#     elif num < num1:
#         print("too small")
#     else:
#         print(" enter a number")
#     c=c+1
# else:
#     print("stupid")
#
# # OR I CAN WRITE:
# if c == 3:
#     print("stupid")
#
#
#

# 7.使用while循环输出 1 2 3 4 5 6 8 9 10
#
# a=0
# while a<10:
#     a=a+1
#     print(a)
#

#
# #
# # 8.求1-100的所有数的和
# a=0
# b=0
# while a<=100:
#     b=a+b
#     a=a+1
# print(b)
#



# #
# # 9.输出 1-100 内的所有奇数
# b=1
# while b<100:
#     print(b)
#     b=b+2
#
# # 10.输出 1-100 内的所有偶数
# b=0
# while b<100:
#     print(b)
#     b=b+2
# #
# # 11.求1-2+3-4+5 ... 99的所有数的和
# a=1
# b=0
# while a<100:
#     b=a+b
#     a=a+2
#
# c=0
# d=0
# while c<100:
#     d=c+d
#     c=c+2
#
#
# print(b-d)
#
# # #
# # 12.⽤户登陆（三次输错机会）且每次输错误时显示剩余错误次数（提示：使⽤字符串格式化）
# #
# name='007'
# password='1234'
# n=0
# while n<3:
#     name1 = input("what is your username")
#     password1 = input('what is your password')
#     if name1==name and password==password1:
#         print(""""
#         --------MI^6 Terminal system--------
#         username:
#         Password:
# #         Welcome back,%s!!!
# #         ------------------------------------
# #         """ % (name1,password1))
# #         break
# #     else:
# #         n = n + 1
# #         print(f"re enter,you have {3-n} chances left")
#
name='007'
password='1234'
n=0
while n<3:
    print("--------MI^6 Terminal system--------")
    name1 = input("what is your username")
    password1 = input('what is your password')
    print("------------------------------------")
    if name1==name and password==password1:
        print(""""
        --------MI^6 Terminal system--------
        username:%s
        Password:%s
        Welcome back,%s!!!
        ------------------------------------
        """%(name1,password1,name1))
        break
    else:
        n = n + 1
        print(f"re enter,you have {3-n} chances left")

# 13.简述ASCII、Unicode、utf-8编码
#
# 14.简述位和字节的关系？
#
# 本周大作业:
# 1.整理这一周的笔记
# 2.将这一周所学的知识整理成思维导图
# 3.将这一周的知识点搞明白后继续预习
# 4.将以上的笔记和思维导图上传到码云





